<?php
	/**
	 * 获取指引列表
	 */
    class GuideList extends APIBase {
		
		public $tag = "GuideList";
		public $isLogin = false;
		
		public function before() {
			$this->initCacheRedis();
			return true;
		}

		public function logic() {
			$guideids = $this->cache_redis->lRange("lg:ids", 0, -1);
			$guides = array();
			foreach ($guideids as $gid) {
				$guide = $this->cache_redis->hMGet("hg:{$gid}", array("no", "index", "title", "content"));
				$guide['$gid'] = (int) $gid;
				$guide['no'] = (int) $guide['no'];
				$guide['index'] = (int) $guide['index'];			
				$guides[] = $guide;
			}
			$this->returnData(array('guides' => $guides));
		}
		
    	public function after() {
			$this->deinitCacheRedis();
		}
    }
?>